/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ivanbiz.impl;

import com.ivanbiz.dao.ReturPenjualanDAO;
import com.ivanbiz.model.HibernateUtil;
import com.ivanbiz.model.ReturPenjualan;
import java.util.List;
import org.hibernate.Session;

/**
 *
 * @author Aprisma
 */
public class ReturPenjualanDAOImpl extends GenericDAOImpl implements ReturPenjualanDAO {

    public void saveItemReturPenjualan(List<ReturPenjualan> listReturPenjualan) throws Exception {
        try {
            HibernateUtil.beginTransaction();
            Session session = HibernateUtil.getSession();
            for (ReturPenjualan returPenjualan : listReturPenjualan) {
                session.save(returPenjualan);
            }
            HibernateUtil.commitTransaction();
        } catch (Exception e) {
            HibernateUtil.rollbackTransaction();
            throw e;
        } finally {
            HibernateUtil.closeSession();
        }
    }
}
